package com.wx.chapter11.homework.homework08;
/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/6/15 - 11:44
 */
public class HomeWork08 {
    public static void main(String[] args) {
        Color defuColor = Color.BLACK;
        switch (defuColor) {//通过switch语句进行匹配
            case RED:
                System.out.println("匹配到红色");
                defuColor.show();
                break;
            case GREEN:
                System.out.println("匹配到绿色");
                defuColor.show();
                break;
            case BLUE:
                System.out.println("匹配到蓝色");
                defuColor.show();
                break;
            case BLACK:
                System.out.println("匹配到黑色");
                defuColor.show();
                break;
            case YELLOW:
                System.out.println("匹配到黄色");
                defuColor.show();
                break;
            default:
                System.out.println("没有匹配到");
                break;
        }
    }
}